getList
<template>
  <div class="Risk">
    <div class="LeftBox">
      <el-button type="primary" @click="toAddView()">添加</el-button>
      <el-button type="primary" @click="goHome()">返回</el-button>
    </div>
    <div class="RightBox">
      <div v-for="value in list.data" :key="value.id" @click="goDetail(value)">
        {{ value.work_task }}
      </div>
    </div>
  </div>
</template>
<script setup>
import { onMounted, reactive } from "vue"
import { getRiskList } from "../../api/Risk"
import router from "../../router"

const list = reactive({
  data: [],
  total: 0
})
onMounted(() => {
  getList()
})
const getList = async () => {
  const res = await getRiskList({ type: "hot", pageIndex: 1, pageSize: 10 })
  if (res.ret) {
    list.data = res.data
    console.log(res)
  }
}
const toAddView = function () {
  router.push("/addRisk")
}
const goHome = function () {
  router.push("/")
}
const goDetail = function (value) {
  router.push("/riskDetail/" + value.id)
}
</script>
<style>
.Risk {
  width: 100%;
  height: 100%;
  background-image: url("../../assets/image/main/MainBg.jpg");
  background-size: 100% 100%;
  color: #fff;
  display: flex;
  align-items: center;
}

.LeftBox {
  width: 20%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
}

.LeftBox div {
  margin: 100px 0;
  cursor: pointer;
}
</style>
